import SendGQL from "@/api/SendGQL";

//创建寺庙
const CreateTemple = `
  mutation CreateTemple ($temple: templeInPut) {
    createTemple (temple: $temple)
  }
`;
export const createTemple = (temple) => {
  // console.log(temple);
  return SendGQL({
    query: CreateTemple,
    variables: {
      temple,
    },
  });
};

//人员创建
const CreatePerson = `
  mutation CreatePerson ($person: personInPut) {
    createPerson (person: $person)
  }
`;
export const createPerson = (person) => {
  return SendGQL({
    query: CreatePerson,
    variables: {
      person,
    },
  });
};

//线索
const CreateClue = `
  mutation CreateClue ($clue: clueInPut) {
    createClue (clue: $clue)
  }
`;
export const createClue = (clue) => {
  return SendGQL({
    query: CreateClue,
    variables: {
      clue,
    },
  });
};
//涉案物品
const CreateInvolved = `
  mutation CreateInvolved ($involved: involvedInPut) {
    createInvolved (involved: $involved)
  }
`;
export const createInvolved = (involved) => {
  return SendGQL({
    query: CreateInvolved,
    variables: {
      involved,
    },
  });
};
//涉枪涉爆重点人员
const CreatePersonnel = `
  mutation CreateClue ($personnel: personnelInPut) {
    createPersonnel (personnel: $personnel)
  }
`;
export const createPersonnel = (personnel) => {
  return SendGQL({
    query: CreatePersonnel,
    variables: {
      personnel,
    },
  });
};

//涉枪涉爆案件
const CreateGunInvolved = `
  mutation CreateGunInvolved ($gunInvolved: gunInvolvedInPut) {
    createGunInvolved (gunInvolved: $gunInvolved)
  }
`;
export const createGunInvolved = (gunInvolved) => {
  return SendGQL({
    query: CreateGunInvolved,
    variables: {
      gunInvolved,
    },
  });
};



//创建治安重点人员信息
const CreateSuspects = `
mutation CreateSuspects ($suspects: suspectsInPut) {
  createSuspects (suspects: $suspects)
  }
`;

export const createSuspects = (suspects) => {

  return SendGQL({
    query: CreateSuspects,
    variables: {
      suspects,
    },
  });
};

//创建刑嫌人员列信息
const CreateSecurity = `
mutation CreateSecurity ($security: securityInPut) {
  createSecurity (security: $security)
}
`;

export const createSecurity = (security) => {

  return SendGQL({
    query: CreateSecurity,
    variables: {
      security,
    },
  });
};

//创建出入境人员列信息
const CreateOutbound = `
mutation CreateOutbound ($outbound: outboundInPut) {
  createOutbound (outbound: $outbound)
  }
`;

export const createOutbound = (outbound) => {

  return SendGQL({
    query: CreateOutbound,
    variables: {
      outbound,
    },
  });
};

//创建房屋信息
const CreateHouse = `
mutation CreateHouse ($house: houseInPut) {
  createHouse (house: $house)
  }
`;

export const createHouse = (house) => {
  return SendGQL({
    query: CreateHouse,
    variables: {
      house,
    },
  });
};

//创建方案信息
const CreatePlan = `
mutation CreatePlan ($plan: planInPut) {
  createPlan (plan: $plan)
  }
`;

export const createPlan = (plan) => {
  return SendGQL({
    query: CreatePlan,
    variables: {
      plan,
    },
  });
};

//创建单位控制信息
const CreateBusiness = `
mutation CreateBusiness ($business: businessInPut) {
  createBusiness (business: $business)
  }
`;

export const createBusiness = (business) => {
  return SendGQL({
    query: CreateBusiness,
    variables: {
      business,
    },
  });
};

//创建重要点位信息
const CreatePoints = `
mutation CreatePoints ($points: pointsInPut) {
  createPoints (points: $points)
  }
`;

export const createPoints = (points) => {

  return SendGQL({
    query: CreatePoints,
    variables: {
      points,
    },
  });
};

//创建车辆信息
const CreateCar = `
mutation CreateCar ($car: carInPut) {
  createCar (car: $car)
  }
`;

export const createCar = (car) => {

  return SendGQL({
    query: CreateCar,
    variables: {
      car,
    },
  });
};

//创建佛寺活动
const CreateActivity = `
mutation CreateActivity ($activity: activityInPut) {
  createActivity (activity: $activity)
  }
`;

export const createActivity = (activity) => {

  return SendGQL({
    query: CreateActivity,
    variables: {
      activity,
    },
  });
};

//创建矛盾纠纷详情
const CreateContradiction = `
mutation CreateContradiction ($contradiction: contradictionInPut) {
  createContradiction (contradiction: $contradiction)
  }
`;

export const createContradiction = (contradiction) => {
  return SendGQL({
    query: CreateContradiction,
    variables: {
      contradiction,
    },
  });
};

//创建矛盾详情information
const CreateInformation = `
mutation CreateInformation ($information: informationInPut) {
  createInformation (information: $information)
  }
`;

export const createInformation = (information) => {
  return SendGQL({
    query: CreateInformation,
    variables: {
      information,
    },
  });
};

//创建政保人员SecPersonnel
const CreateSecPersonnel = `
mutation CreatePersonnel ($personnel: personnelInPut) {
  createPersonnel (personnel: $personnel)
  }
`;

export const createSecPersonnel = (secpersonnel) => {
  return SendGQL({
    query: CreateSecPersonnel,
    variables: {
      secpersonnel,
    },
  });
};

//创建僧人人员monkInPut
const CreateMonk = `
mutation CreateMonk ($monk: monkInPut) {
  createMonk (monk: $monk)
  }
`;

export const createMonk = (monk) => {
  return SendGQL({
    query: CreateMonk,
    variables: {
      monk,
    },
  });
};

//创建管理员Manager
const CreateManager = `
mutation CreateManager ($manager: managerInPut) {
  createManager (manager: $manager)
  }
`;

export const createManager = (manager) => {
  return SendGQL({
    query: CreateManager,
    variables: {
      manager,
    },
  });
};

//创建会员Member
const CreateMember = `
mutation CreateMember ($password: String, $avatarUrl: String,  $account: String, $name: String, $root: String, $belong: String) {
  createMember (password: $password, avatarUrl: $avatarUrl, account: $account, name: $name, code: $code, root: $root, belong: $belong)
  }
`;

export const createMember = (params) => {
  const { password, avatarUrl,  account, name, root, belong} = params
  return SendGQL({
    query: CreateMember,
    variables: {
      password,
      avatarUrl,
      
      account,
      name,
      belong,
      root
    },
  });
};

